//
//  AYMMKV.h
//  SuiXin
//
//  Created by boWen on 2023/10/17.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface AYMMKV : NSObject


#pragma mark - set存储

+ (BOOL)setString:(NSString *)value forKey:(NSString *)key;

+ (BOOL)setData:(NSData *)value forKey:(NSString *)key;

+ (BOOL)setBool:(BOOL)value forKey:(NSString *)key;

+ (BOOL)setFloat:(float)value forKey:(NSString *)key;

+ (BOOL)setInt64:(uint64_t)value forKey:(NSString *)key;

+ (BOOL)setUInt32:(uint32_t)value forKey:(NSString *)key;


#pragma mark - get取值

+ (nullable NSString *)getStringForKey:(NSString *)key;
+ (nullable NSString *)getStringForKey:(NSString *)key defaultValue:(nullable NSString *)defaultValue;

+ (nullable NSData *)getDataForKey:(NSString *)key;
+ (nullable NSData *)getDataForKey:(NSString *)key defaultValue:(nullable NSData *)defaultValue;

+ (float)getFloatForKey:(NSString *)key;

+ (float)getFloatForKey:(NSString *)key defaultValue:(float)defaultValue;

+ (int32_t)getInt32ForKey:(NSString *)key defaultValue:(int32_t)defaultValue;

+ (int32_t)getInt32ForKey:(NSString *)key;

+ (int64_t)getInt64ForKey:(NSString *)key;
+ (int64_t)getInt64ForKey:(NSString *)key defaultValue:(int64_t)defaultValue;


+ (BOOL)getBoolForKey:(NSString *)key;
+ (BOOL)getBoolForKey:(NSString *)key defaultValue:(BOOL)defaultValue;

//是否存在某个key
+ (BOOL)containsKey:(NSString *)key;

#pragma mark - 移除某个key

+ (void)removeValueForKey:(NSString *)key;

#pragma mark - 删除多个

+ (void)removeValuesForKeys:(NSArray *)arrKeys;

#pragma mark - 删除所有键值，删除磁盘文件

+ (void)close;

#pragma mark - 删除缓存，不删除磁盘文件

+ (void)clearMemoryCache;

@end

NS_ASSUME_NONNULL_END
